//
//  OosAvatar.m
//  Oos4ios
//
//  Created by Pablo Gonzalez on 3/21/11.
//  Copyright 2011 11870.com. All rights reserved.
//

#import <oos4ios/Model/OosAvatarImage.h>


static NSString *fetchPredicate = @"urlString = %@";

@implementation OosAvatarImage

+ (OosAvatarImage *) avatarFromPath:(NSString *)path
{
    
    OosAvatarImage *result = [super objectWithPredicate: fetchPredicate, path];
    if (!result) {
        result = [super create];
        result.urlString = path;
    }
    
    return result;
    
//	NSSet *fetched = [super objectsWithPredicate: fetchPredicate, path];
//	OosAvatarImage *image;
//	if ([fetched count] > 0) {
//		image = [fetched anyObject];
//	} else {
//		image = [super create];
//		image.urlString = path;
//	}
//	return image;
}


@end
